package com.example.controller;

import com.example.entity.SpotCheckItem;
import com.example.entity.SpotCheckPlan;
import com.example.service.SpotCheckItemService;
import com.example.service.SpotCheckPlanService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 维保检查项
 */
@RestController
@RequestMapping("api/spotCheckItem")
public class SpotCheckItemController {

    @Autowired
    public SpotCheckItemService potCheckItemService;


    /**
     * 新增数据
     */
    @ApiOperation(value = "新增维保计划检查项的所有数据", notes = "新增列表信息")
    @RequestMapping(value = "insert", method = RequestMethod.POST)
    private Map<String, Object> insert(@RequestBody Map map) {
        Map<String, Object> resultMap = potCheckItemService.insert(map);
        return resultMap;
    }
    /**
     * 查询数据
     */

    @ApiOperation(value = "查询维保计划检查项的所有数据", notes = "查询列表信息")
    @RequestMapping(value = "findList", method = RequestMethod.POST)
    private Map<String, Object> findList(@RequestBody Map map) {
        Map<String, Object> resultMap = potCheckItemService.findList(map);
        return resultMap;
    }

    /**
     * 查询数据
     */
    @ApiOperation(value = "通过id删除自定义项的维保内容", notes = "删除自定义维保内容")
    @RequestMapping(value = "deleteById", method = RequestMethod.POST)
    private Map<String, Object> deleteById(@RequestBody Map map) {
        Map<String, Object> resultMap = potCheckItemService.deleteById(map);
        return resultMap;
    }

    /**
     * App端查询检查项数据
     */
    @ApiOperation(value = "App端查询检查项数据", notes = "App端查询检查项数据")
    @RequestMapping(value = "findCheckItemApp", method = RequestMethod.POST)
    private Map<String, Object> findCheckItemApp(@RequestBody Map map) {
        Map<String, Object> resultMap = potCheckItemService.findCheckItemApp(map);
        return resultMap;
    }

    /**
     * App端新增检查项数据
     */
    @ApiOperation(value = "App端新增检查项数据", notes = "App端查询检查项数据")
    @RequestMapping(value = "addCheckItemApp", method = RequestMethod.POST)
    private Map<String, Object> addCheckItemApp(@RequestBody Map map) {
        Map<String, Object> resultMap = potCheckItemService.addCheckItemApp(map);
        return resultMap;
    }

    /**
     * App端查询电梯信息
     */
    @ApiOperation(value = "App端查询电梯信息", notes = "App端查询电梯信息")
    @RequestMapping(value = "findElevatorInfoApp", method = RequestMethod.POST)
    private Map<String, Object> findElevatorInfoApp(@RequestBody Map map) {
        Map<String, Object> resultMap = potCheckItemService.findElevatorInfoApp(map);
        return resultMap;
    }

    /**
     * App端多个电梯的缓存
     */
    @ApiOperation(value = "App端多个电梯的缓存", notes = "App端多个电梯的缓存")
    @RequestMapping(value = "querySpotCheckCacheApp", method = RequestMethod.POST)
    private Map<String, Object> querySpotCheckCacheApp(@RequestBody Map map) {
        Map<String, Object> resultMap = potCheckItemService.querySpotCheckCacheApp(map);
        return resultMap;
    }



}
